
<!DOCTYPE html>
<html>
    {include file="public/head"}
    <body>
        <div class="fly-panel">
            <h3 style="text-align: center;">Problem ID:{$data.problem_id}</h3>
            <br />
            <form method="post" action="{:url('admin/problem/editor_opt',['id'=>$data.problem_id])}" class="layui-form layui-form-pane">
                <div class="layui-form-item" >
                <label class="layui-form-label">管理需知:</label>
                <div class="layui-input-block">
                    <a href="{:url('web/index/help_admin')}" target="_blank" class="layui-btn">点击查看</a>
                </div>
            </div>
                
                <div class="layui-form-item">
                    <label class="layui-form-label">标题:</label>
                    <div class="layui-input-block">
                        <input type="text" name="title" class="layui-input" value="{$data.title}">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">时间限制:</label>
                    <div class="layui-input-inline">
                        <input type="text" name="time_limit" class="layui-input" value="{$data.time_limit}">
                    </div>
                    <div class="layui-form-mid layui-word-aux">S</div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">空间限制:</label>
                    <div class="layui-input-inline">
                        <input type="text" name="memory_limit" class="layui-input" value="{$data.memory_limit}">
                    </div>
                    <div class="layui-form-mid layui-word-aux">MB</div>
                </div>
                
                <div class="layui-form-item" style="margin-top: 20px;">
			<label class="layui-form-label">难度:</label>
			<div class="layui-input-block">
                            <input type="text" name="score" class="layui-input" value="{$data.score}">
			</div>
		</div>

                <div class="layui-form-item">
                    <label class="layui-form-label">问题描述:</label>
                    <textarea id="description" class='layui-hide' name="description">{$data.description}</textarea>
                </div>
                <div style="padding-bottom: 20px;" class="nyoj-clear-width">
                    <div id='description-ed'>{$data.description}</div> 
                </div>
            

                <div class="layui-form-item">
                    <label class="layui-form-label">输入描述:</label>
                    <textarea id="input" class="layui-textarea" name="input">{:htmlspecialchars($data.input)}</textarea>
                </div>		

                <div class="layui-form-item">
                    <label class="layui-form-label">输出描述:</label>
                    <textarea id="output" class="layui-textarea" name="output">{:htmlspecialchars($data.output)}</textarea>
                </div>


                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">样例输入:</label>
                    <div class="layui-input-block">
                        <textarea id="sample_input" class="layui-textarea" name="sample_input">{$data.sample_input}</textarea>
                    </div>
                </div>

                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">样例输出:</label>
                    <div class="layui-input-block">
                        <textarea id="sample_output" class="layui-textarea" name="sample_output">{$data.sample_output}</textarea>
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">提示:</label>
                    <textarea id="hint" style="display: none;" class="layui-hide" name="hint">{$data.hint}</textarea>
                </div>
                <div style="padding-bottom: 20px;" class="nyoj-clear-width">
                    <div id='hint-ed'>{$data.hint}</div> 
                </div> 
                
                <div class="layui-form-item" pane>
                    <label class="layui-form-label">特判:</label>
                    <div class="layui-input-block">
                        <input type="radio" name="spj" value="1" title="是" {eq name="data.spj" value="1" }checked{/eq}>
                               <input type="radio" name="spj" value="0" title="否" {eq name="data.spj" value="0" }checked{/eq}>
                    </div>
                </div>
                
        

                <div class="layui-form-item" style="margin-top: 20px;">
                    <label class="layui-form-label">来源:</label>
                    <div class="layui-input-block">
                        <input type="text" name="source" class="layui-input" value="{$data.source}">
                    </div>
                </div>
                

                <div style="text-align: center;">
                    <input type="submit" name="" value="提交" class="layui-btn" >
                </div>
            </form>
        </div>
        {include file="public/end"}

<script type="text/javascript" src="__STATIC__/WE/wangEditor.min.js"></script>
<script>
    
layui.use(['form','jquery'],function(){
    var $=layui.jquery;
    
    var E = window.wangEditor;  
        var editor = new E('#description-ed');
        editor.customConfig.uploadImgServer = '/api/uploadimage'; // 上传图片到服务器
        editor.customConfig.uploadImgMaxSize = 3 * 1024 * 1024;
        editor.customConfig.uploadFileName = 'file';
        editor.customConfig.zIndex = 0;
        var $text1 = $('#description');
        editor.customConfig.onchange = function (html) {
            // 监控变化，同步更新到 textarea
            $text1.val(html);
        };
        editor.customConfig.menus = [
        'head',  // 标题
    'bold',  // 粗体
    'fontSize',  // 字号
    'fontName',  // 字体
    'italic',  // 斜体
    'underline',  // 下划线
    'strikeThrough',  // 删除线
    'foreColor',  // 文字颜色
    'backColor',  // 背景颜色
    'link',  // 插入链接
    'list',  // 列表
    'justify',  // 对齐方式
    'quote',  // 引用
    'image',  // 插入图片
    'table',  // 表格
    'video',  // 插入视频
    'code',  // 插入代码
    'undo',  // 撤销
    'redo'  // 重复
    ];
        editor.create();
        $text1.val(editor.txt.html());
});
layui.use(['form','jquery'],function(){
    var $=layui.jquery;
    
    var E = window.wangEditor;  
        var editor = new E('#hint-ed');
        editor.customConfig.uploadImgServer = '/api/uploadimage'; // 上传图片到服务器
        editor.customConfig.uploadImgMaxSize = 3 * 1024 * 1024;
        editor.customConfig.uploadFileName = 'file';
        var $text1 = $('#hint');
        editor.customConfig.onchange = function (html) {
            // 监控变化，同步更新到 textarea
            $text1.val(html);
        };
        editor.customConfig.menus = [
        'head',  // 标题
    'bold',  // 粗体
    'fontSize',  // 字号
    'fontName',  // 字体
    'italic',  // 斜体
    'underline',  // 下划线
    'strikeThrough',  // 删除线
    'foreColor',  // 文字颜色
    'backColor',  // 背景颜色
    'link',  // 插入链接
    'list',  // 列表
    'justify',  // 对齐方式
    'quote',  // 引用
    'image',  // 插入图片
    'table',  // 表格
    'video',  // 插入视频
    'code',  // 插入代码
    'undo',  // 撤销
    'redo'  // 重复
    ];
        editor.create();
        $text1.val(editor.txt.html());
});
</script>
</html>